import request from '@/config/axios'

// 线下店活动 VO
export interface ActivityVO {
  id: number // 编号
  img: string // 活动图片
  description: string // 活动图片
  title: string // 标题
  status: number // 状态
}

// 线下店活动 API
export const ActivityApi = {
  // 查询线下店活动分页
  getActivityPage: async (params: any) => {
    return await request.get({ url: `/store/activity/page`, params })
  },

  // 查询线下店活动详情
  getActivity: async (id: number) => {
    return await request.get({ url: `/store/activity/get?id=` + id })
  },

  // 新增线下店活动
  createActivity: async (data: ActivityVO) => {
    return await request.post({ url: `/store/activity/create`, data })
  },

  // 修改线下店活动
  updateActivity: async (data: ActivityVO) => {
    return await request.put({ url: `/store/activity/update`, data })
  },

  // 删除线下店活动
  deleteActivity: async (id: number) => {
    return await request.delete({ url: `/store/activity/delete?id=` + id })
  },

  // 导出线下店活动 Excel
  exportActivity: async (params) => {
    return await request.download({ url: `/store/activity/export-excel`, params })
  },
}